from datetime import datetime

from werkzeug.security import check_password_hash, generate_password_hash

from pear_admin.extensions import db

from ._base import BaseORM

class StudentORM(BaseORM):
    __tablename__ = "school_student"

    id = db.Column(db.Integer, primary_key=True, comment="自增id")
    name = db.Column(db.String(128), nullable=False, comment="姓名")
    math = db.Column(db.Integer, nullable=False, comment="数学")
    english = db.Column(db.Integer, nullable=False, comment="英语")
    chinese = db.Column(db.Integer, nullable=False, comment="语文")

    def json(self):
        return {
            "id": self.id,
            "name": self.name,
            "math": self.math,
            "english": self.english,
            "chinese": self.chinese,
        }

